{extend name="common/base"/}
{block name="style"}
<link rel="stylesheet" href="{__CSS__}/index.css?v={:get_system_config('web','version')}">
<link rel="stylesheet" href="{__JS__}/aos/aos.css" />
{/block}
<!-- 主体 -->
{block name="body"}
{include file="common/header" nav='info' /}


<section class="banner" style="position:relative;">
	<div class="container">
		<div class="banner-text">
			<h1 data-aos="fade-up">小学信息科技学科平台，让学习更简单！</h1>
			<h2 data-aos="fade-up" data-aos-delay="40">
			基于ThinkPHP6 + Layui + MySql的轻量级学科学习平台，适用于中小学信息科技教学的管理平台。<br/>
			具有管理方便，对接浙江省中小学信息科技学科平台，有效提高课堂管理效率。</h2>
			<div data-aos="fade-up" data-aos-delay="80">
				<a href="http://122.226.152.186:8002/" class="btn-down" target="_blank"><span>心理健康测评</span></a>
				<a href="/" class="btn-go" target="_blank"><span>进入教室保持安静，安指定位置就座</span></a>
			<!-- 	<span class="btn-view">查看体验账号</span> -->
			</div>

  	</div>
		<div class="banner-img" data-aos="zoom-out" data-aos-delay="30">
			<img src="{__IMG__}/banner_img.png" alt="">
		</div>
		<!-- 签到	 -->
		{notempty name="$params.uid"}
		<div class="layui-container signin-container">
		  <div class="layui-row">
		    <div class="layui-col-md12">
		      <!-- 签到按钮 -->
		      <button class="layui-btn layui-btn-normal signin-btn" id="signinBtn">
		        <i class="layui-icon layui-icon-face-smile"></i> 签到
		      </button>
		      <!-- 签到状态 -->
		      <div class="signin-status" id="signinStatus">
		      	{if 'true'==$is_signed}
		      	今日已签到
		      	{else}
		        今日未签到
		      	{/if}
		      </div>
		    </div>
		  </div>
		</div>
		{/notempty}
		<!-- 签到end -->
	</div>
</section>

</div>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script src="{__LAYUI__}/layui.js"></script>
<script>
  layui.use(['layer'], function () {
    var layer = layui.layer;
    var signinBtn = document.getElementById('signinBtn');
    var signinStatus = document.getElementById('signinStatus');

    // 模拟签到状态
    var isSigned = {$is_signed};
    if(isSigned){
    	signinBtn.classList.remove('layui-btn-normal');
      signinBtn.classList.add('layui-btn-disabled');
      signinBtn.innerHTML = '<i class="layui-icon layui-icon-ok"></i> 已签到';
      signinStatus.innerHTML = '今日已签到';
      signinStatus.style.color = '#5FB878';
    }else{
    	signinBtn.classList.add('layui-btn-normal');
	    signinBtn.classList.remove('layui-btn-disabled');
    }

    // 签到按钮点击事件
    signinBtn.onclick = function (data) {


		    //将表单数据提交到后台
		    $.post("/home/index/do_signin", {uid:{$params.uid}},function(resp){
		    		isSigned = true;	        
	          signinBtn.classList.remove('layui-btn-normal');
	          signinBtn.classList.add('layui-btn-disabled');
						signinBtn.innerHTML = '<i class="layui-icon layui-icon-ok"></i> 已签到';
            signinStatus.innerHTML = '今日已签到';
            signinStatus.style.color = '#5FB878';
 
					if (resp.code === 0) {					
							layer.msg(resp.msg,{ time:5000,icon: 1 });
					}else{						
						layer.msg(resp.msg, { icon: 2,time:5000 });
					}

		    });
			return false;

    };
  });
</script>
	<script src="{__JS__}/aos/aos.js"></script>
  <script>
    AOS.init({
      easing: 'ease-in-out-sine'
    });

  </script>
{/block}
<!-- /脚本 -->